home *** CD-ROM | disk | FTP | other *** search
- Path: cyb.gridpoint.com!loodvrij
- From: "Bruce J. Keeler" <loodvrij@cyb.gridpoint.com>
- Newsgroups: comp.lang.c++
- Subject: STL container classes and destroy()
- Date: Sun, 4 Feb 1996 20:23:27 -0900
- Organization: Internet Alaska, Inc.
- Message-ID: <Pine.BSF.3.91.960204202036.7806A-100000@cyb.gridpoint.com>
- NNTP-Posting-Host: cyb.alaska.net
- Mime-Version: 1.0
- Content-Type: TEXT/PLAIN; charset=US-ASCII
-
- Hi. I have a question about the STL container classes and their use with
- user-defined types. The test program below fails to compile as shown.
- If I use vector<asdf *> it compiles but gives a warning similar to the message
- shown.
-
- In the stl defalloc.h file I notice a whole bunch of versions of
- destroy(foo) one for each built-in type. Are we expected to include similar
- definitions in the header files for our classes? Doing so certainly seems
- to get rid of the messages, but it still seems kinda klunky and possibly
- just darn wrong to me.
-
- Compiler is the AIX xlC compiler, version (I think) 1.1.2.
-
- Thanks.
- ---------------------------------------8<---------------------------------
- #include <vector.h>
-
- class asdf
- {
- asdf() {}
- ~asdf() {}
- int spam;
- };
-
- class Blah
- {
- vector<asdf> asdfList;
- };
-
- int main (int, char **)
- {
- Blah blah;
- }
-
- xlC -+ -U__STR__ -Istl -g
- -DMOD_SYM=3Dctgnd -DMODULE_NAME=3D"ctgnd" -c vector-test.cc
- "stl/defalloc.h", line 74.1: 1540-013: (S) "~T" is undefined.
- "stl/defalloc.h", line 73.1: 1540-207: (I) The previous message applies
- to the definition of template "destroy(asdf*)".
-
-
-
-
-
- Bruce J. Keeler Internet: loodvrij@gridpoint.com
- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- "Never trust an Operating System you don't have source code for."
-
-